﻿/**
 * Copyright © TnT-VNGroup 2011
 * PROJECT:   SmartCollector
 * $HeadURL: https://smartcollector.googlecode.com/svn/branches/Srcs/SmartCollector.HtmlParser/Utilities/Attribute.cs $
 * $Author: chithanh12 $
 * $Date: 2011-04-09 00:11:43 +0700 (Sat, 09 Apr 2011) $
 * $Rev: 60 $
 **/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using log4net;
using log4net.Config;

namespace SmartCollector
{
    public static class Logger
    {
        #region Members
        private static readonly ILog logger = LogManager.GetLogger(typeof(Logger));
        #endregion

        static Logger()
        {
            XmlConfigurator.Configure();
        }

        #region Methods
        public static void WriteLog(ELogLevel logLevel, String log)
        {
            if (logLevel.Equals(ELogLevel.DEBUG))
            {
                logger.Debug(log);
            }
            else if (logLevel.Equals(ELogLevel.ERROR))
            {
                logger.Error(log);
            }
            else if (logLevel.Equals(ELogLevel.FATAL))
            {
                logger.Fatal(log);
            }
            else if (logLevel.Equals(ELogLevel.INFO))
            {
                logger.Info(log);
            }
            else if (logLevel.Equals(ELogLevel.WARN))
            {
                logger.Warn(log);
            }
        }
        #endregion
    }
}
